package iq.preference;

import java.util.prefs.Preferences;

import org.junit.Assert;
import org.junit.Test;

public class TestPreference {

	@Test
	public void setValue() {
		Preferences node = Preferences.userNodeForPackage(TestPreference.class);
		node.put("backgroundColor", "Blue");
		
		node.put("name", "大海啊");
	}

	@Test
	public void getValue() {
		Preferences node = Preferences.userNodeForPackage(TestPreference.class);
		String str = node.get("backgroundColor", "haha");
		Assert.assertSame(str, "Blue");
		str = node.get("name", "没名字");
		Assert.assertSame(str, "大海啊");
	}
}
